<template>
  <div id="app">
    <router-view />
    <theme-picker />
  </div>
</template>

<script>
import ThemePicker from "@/components/ThemePicker";
import { getEmail } from "@/api/yxzx/email";
export default {
  name: "App",
  components: { ThemePicker },
  data() {
    return {
      queryParams:{
        pageindex: 1,
        pagesize: 10,
        ishuifu: 2,
        neirong: '',
      }
    }
  },
  // beforeCreate() {
  //   getEmail(
  //     this.queryParams.pageindex,
  //     this.queryParams.pagesize,
  //     this.queryParams.ishuifu,
  //     this.queryParams.neirong,
  //     ).then((response) => {
  //        if(response.resultContent.AskList.length > 0){
  //         document.querySelector('body').setAttribute('style', '-webkit-filter: grayscale(100%);-moz-filter: grayscale(100%);-ms-filter: grayscale(100%);-o-filter: grayscale(100%);filter: grayscale(100%);filter: gray;')
  //         document.body.style.filter = 'grayscale(100%)'
  //        }
  //   });
    
  // },
  mounted() {
      // getEmail(
      //   this.queryParams.pageindex,
      //   this.queryParams.pagesize,
      //   this.queryParams.ishuifu,
      //   this.queryParams.neirong,
      //   ).then((response) => {
      //     if(response.resultContent.AskList.length > 0){
      //       document.body.style.filter = 'grayscale(100%)'
      //     }
      // });   
  },
  metaInfo() {
    return {
      title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
      titleTemplate: title => {
        return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
      }
    }
  }
};
</script>
<style scoped>


#app .theme-picker {
  display: none;
}
</style>
